<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: LQ
  Date: 2021/5/19
  Time: 19:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/jQuery/jquery-3.4.1.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/css/panel.css">
</head>
<body>

<div>
    <jsp:include page="main.jsp"></jsp:include>
</div>
<div style="margin-left: 30%;margin-top: 1%">
    <div class="panel_div">
        <table border="1px" class="content_div">
            <tr>
                <td class="article_td">发布了${requestScope.articleNum}篇文章</td>
                <td class="comment_td">收到了${requestScope.commentNum}条留言</td>
            </tr>
            <tr>
                <td class="document_td">上传了${requestScope.documentNum}个文件</td>
                <td class="link_td">友链了${requestScope.linkNum}个好友</td>
            </tr>
        </table>
    </div>

    <div class="content_div">
        <div class="latest_article_div">
            <h2>最新的文章</h2>
            <table border="1px">
                <tr>
                    <td>文章标题</td>
                    <td>发布时间</td>
                </tr>

                <c:forEach items="${requestScope.latestArticleList}" var="article">
                    <tr>
                        <td><a href="/preview?aId=${article.articleId}">${article.articleName}</a></td>
                        <td>${article.articleInsertTime}</td>
                    </tr>
                </c:forEach>

            </table>
        </div>

        <div class="latest_comment_div">
            <h2 class="log">最新的留言</h2>
            <hr class="log">
            <c:forEach items="${requestScope.latestCommentList}" var="comment">
                <h6 class="log">${comment.user.userName}于${comment.commentInsertTime}:</h6>
                <h6 class="log">${comment.commentContent}</h6>
                <hr class="log">
            </c:forEach>
        </div>

        <div>
            <h2>系统日志</h2>
            <table border="1px">
                <c:forEach items="${requestScope.logList}" var="log">
                    <tr>
                        <td>${log.logTime}==>${log.logContent.logContent}</td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
</div>
<div style="margin-top: 245px">
    <jsp:include page="bottom.jsp"/>
</div>
</body>
</html>
